import java.util.Scanner;

public class ForAndArray {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double ar[] = new double[5];
		double sum = 0;
		for (int i = 0; i < ar.length; i++) {
			System.out.println("请输入第" + (i + 1) + "笔购物金额：");
			ar[i] = sc.nextDouble();
		}
		// 求和
		for (int i = 0; i < ar.length; i++) {
			sum = sum + ar[i];
		}
		// 输出每笔金额和求和放到一起
		System.out.println("序号\t\t金额");
		for (int i = 0; i < ar.length; i++) {
			System.out.println((i + 1) + "\t\t" + ar[i]);
		}
		System.out.println("总金额\t " + sum);
	}

}
